################################
#  Config File for raspimjpeg  #
################################
# Syntax: "Command Param", no spaces before/after line allowed

#
# Camera Options
#
# annotation max length: 31 characters
annotation RPi Cam %Y.%M.%D_%h:%m:%s
anno_background false
anno3_custom_background_colour 0
anno3_custom_background_Y 0
anno3_custom_background_U 128
anno3_custom_background_V 128
anno3_custom_text_colour 0
anno3_custom_text_Y 255
anno3_custom_text_U 128
anno3_custom_text_V 128
anno_text_size 50

sharpness 0
contrast 0
brightness 50
saturation 0
iso 0
metering_mode average
video_stabilisation false
exposure_compensation 0
exposure_mode auto
white_balance auto
autowbgain_r 150
autowbgain_b 150
image_effect none
colour_effect_en false
colour_effect_u 128
colour_effect_v 128
rotation 0
hflip false
vflip false
sensor_region_x 0
sensor_region_y 0
sensor_region_w 65536
sensor_region_h 65536
shutter_speed 0
raw_layer false
stat_pass 0

# camera_num 0 - no selection. 1/2 selects first or second camera on compute module
camera_num 0

#MMAL settings
minimise_frag 0
#mmal_logfile used for debugging callbacks (set to /dev/shm/mjpeg/mmallogfile for short periods only)
mmal_logfile

#
# Preview Options
#
# fps_preview = video_fps (below) / divider
#
width 512
quality 10
divider 1

#
# Video Options
#
video_width 1920
video_height 1080
video_fps 25
video_bitrate 17000000
video_buffer 0
#h264_buffer_size 0 sets to default (65536) Higher gives smoother set of callbacks
h264_buffer_size 131072
h264_buffers 0
video_split 0

#MP4Box Off=leave as raw h264, background=box in background
MP4Box background
MP4Box_fps 25
MP4Box_cmd (set -e;MP4Box -fps %i -add %s %s > /dev/null 2>&1;rm "%s";) &
#
# Image Options
#
image_width 2592
image_height 1944
image_quality 10

#time lapse interval 0.1 sec units
tl_interval 30

#
# Motion Detection
#
motion_external true
vector_preview false
vector_mode ?
motion_noise 1010
motion_threshold 250
motion_clip 0
motion_image
motion_startframes 3
motion_stopframes 150
motion_pipe /var/www/FIFO1
motion_file 0

#
# File Locations
#
# preview path: add %d for number
# image+video path: add %d for number, year, month, day, hour, minute, second
# macros_path can be used to store macros executed by sy command
# boxing_path if set is where h264 files will be temporarily stored when boxing used
# image, video and lapse may be configured relative to media_path if first / left out
base_path /var/www
preview_path /dev/shm/mjpeg/cam.jpg
image_path /var/www/media/im_%i_%Y%M%D_%h%m%s.jpg
lapse_path /var/www/media/tl_%i_%t_%Y%M%D_%h%m%s.jpg
video_path /var/www/media/vi_%v_%Y%M%D_%h%m%s.mp4
status_file /dev/shm/mjpeg/status_mjpeg.txt
control_file /var/www/FIFO
media_path /var/www/media
macros_path /var/www/macros
user_annotate /dev/shm/mjpeg/user_annotate.txt
boxing_path
subdir_char @
count_format %04d

#Job macros - prefix with & to make it run asynchronously
error_soft error_soft.sh
error_hard error_hard.sh
start_img start_img.sh
end_img &end_img.sh
start_vid &start_vid.sh
end_vid end_vid.sh
end_box &end_box.sh
do_cmd &do_cmd.sh
motion_event motion_event.sh

# thumb generator control
# Set v, i, or t in string to enable thumbs for images, videos, or lapse
thumb_gen vit

#
# Autostart
#
# autostart: standard/idle
# motion detection can only be true if autostart is standard
#
autostart standard
motion_detection false

# Watchdog
# Interval in 0.1 secs
# Errors is Number of times cam.jpg doesn't change before exit
watchdog_interval 30
watchdog_errors 3
# Set callback_timeout to 0 to disable it
callback_timeout 30
#optional user_config file to overwrite (persist) changes
user_config /var/www/uconfig

#logfile for raspimjpeg, default to merge with scheduler log
log_file /var/www/scheduleLog.txt
log_size 5000
motion_logfile /var/www/motionLog.txt
